package com.cstz.enums;

/**
 * Created by miles on 2017/6/25.
 */
public enum VerificationCodeTypeEnum {
  // 1:注册，2：修改密码,3:修改手机号码
  USER_REGISTRATION("用户注册", 1),
  PASSWORD_MODIFICATION("修改密码", 2),
  MOBILE_PHONE_MODIFICATION("修改手机号码", 3),
  PASSWORD_FIND_BACK("找回密码", 4);

  // 成员变量
  private String name;
  private int index;

  // 构造方法
  private VerificationCodeTypeEnum(String name, int index) {
    this.name = name;
    this.index = index;
  }

  // 普通方法
  public static String getName(int index) {
    for (VerificationCodeTypeEnum c : VerificationCodeTypeEnum.values()) {
      if (c.getIndex() == index) {
        return c.name;
      }
    }
    return null;
  }

  // get set 方法
  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public int getIndex() {
    return index;
  }

  public void setIndex(int index) {
    this.index = index;
  }
}
